package com.bao.work.work08;

import java.util.ArrayList;

/**
 * @author baoye
 * @date 2024-07-29/20:21
 */
public class TestMyArrays {
    public static void main(String[] args) {
        ArrayList<Integer> list=new ArrayList<>();
        list.add(1);
        list.add(3);
        list.add(5);
        list.add(7);
        list.add(2);
        list.add(3);
        list.add(5);
        list.add(1);
        list.add(1);
        System.out.println("原集合:"+list);
        MyArrays.reverse(list);
        System.out.println("反转一次:"+list);
        System.out.println("最大值:"+MyArrays.max(list));
        System.out.println("最小值:"+MyArrays.min(list));

        System.out.println("第一次出现3的下标:"+MyArrays.indexOf(list,3));

        MyArrays.replaceAll(list,1,9);
        System.out.println("替换所有1为9:"+list);
    }
}
